import 'package:flutter/services.dart';

class AsrManager {
  static const MethodChannel _channel = const MethodChannel("asr_plugin");

  //  开始录音
  static Future<dynamic> start({Map? params}) async {
    return await _channel.invokeListMethod("start", params ?? {});
  }

  //  停止录音
  static Future<dynamic> stop() async {
    return await _channel.invokeListMethod(
      "stop",
    );
  }

  //  取消录音
  static Future<dynamic> cancel() async {
    return await _channel.invokeListMethod("cancel");
  }
}
